package com.harmony.pilot.common.exception;

import lombok.Getter;

/**
 * 自定义服务异常
 */
@Getter
public class ServiceException extends RuntimeException {
    
    private static final long serialVersionUID = 1L;
    
    private Integer code;
    
    public ServiceException(String message) {
        super(message);
        this.code = 500;
    }
    
    public ServiceException(Integer code, String message) {
        super(message);
        this.code = code;
    }
    
    public ServiceException(String message, Throwable cause) {
        super(message, cause);
        this.code = 500;
    }
    
    public ServiceException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }
}

